package daytrain.week1;

public class _001 {
    public static int threeOrFive(int num){
        //  num = 1000;
        int res = 0;
        //  加上3的倍数
        res += (3 + 999) * ((999-3)/3 + 1) / 2;
        res += (5 + 995) * ((995-5)/5 + 1) / 2;
        res -= (15 + 990) * ((990-15)/15 + 1) / 2;
        //  233168
        return res;
    }
}
